<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件-计数器</title>
</head>
<body>
<div id="app">
 <!--   <button @click="increment"> {{number}}</button>
    <button @click="increment"> {{number}}</button>
    <button @click="increment"> {{number}}</button>-->
    <counter></counter>
    <counter></counter>
    <counter></counter>
</div>
</body>
<script src="../../lib/vue.js"></script>


<script type="module">

     import component from '../../component/counter.js'
      new Vue({
        el: '#app',
        components:{ // 组件注册:局部注册
             counter:component.counter
        },
        data: {
            number: 0
        }, methods: {
            increment: function () {
                this.number++;
            }
        }
    })

</script>
</html>